package org.example;

import java.util.Random;
import java.util.Scanner;

public class testt1 {
    public static void main(String[] args) {
        int []arr=new int[6];
        Scanner sc=new Scanner(System.in);
        for (int i = 0; i < arr.length; ) {
            System.out.println("请输入分数：");
            int a=sc.nextInt();
            if (a>=0&&a<=100) {
                arr[i]=a;
                i++;
            }
        }
        int max=arr[0];
        for (int i = 0; i < arr.length; i++) {
            if(arr[i]>max){
                max=arr[i];
            }
        }
        System.out.println("Max:"+max);
        int min=arr[0];
        for (int i = 0; i < arr.length; i++) {
            if(arr[i]<min){
                min=arr[i];
            }
        }
        System.out.println("Min:"+min);
        int sum=0;
        for (int i = 0; i < arr.length; i++) {
            sum=sum+arr[i];
        }
        int sum1=sum-min-max;
        int avg=sum1/arr.length-2;
        System.out.println("Avg:"+avg);
    }
}